﻿package 
{

	import flash.display.*;
	import flash.events.*;
	import gemini.particles.*
	import code.ModuleBase;

	public class CoffeeCup extends ModuleBase
	{

		var txts;
		public function CoffeeCup()
		{

			setSmoke();
			
			txts=[];
			txts.push("A cup of coffee shared with a friend is happiness tasted and time well spent.");
			txts.push("Chocolate, men, coffee – some things are better rich.");
			txts.push("Coffee, the finest organic suspension ever devised.");
			txts.push("Caffeine isn’t a drug, it’s a vitamin !!");
			txts.push("A cup of coffee shared with a friend is happiness tasted and time well spent.");
			txts.push("Only Irish coffee provides in a single glass all four essential food groups: alcohol, caffeine, sugar, and fat.");
			txts.push("Espresso is to Italy, what champagne is to France.");
			txts.push("There has never been a better office communication system than the coffee break.");
			txts.push("A cup of coffee shared with a friend is happiness tasted and time well spent.");
			txts.push("I don’t have a problem with caffeine. I have a problem without caffeine.");
			txts.push("On the eighth day God created coffee.");
			
			
			
			

			//
			modname.eng = "Coffee poetry";
			modname.hr = "Salica Kave";

			//
			title.eng = "Coffee poetry";
			title.hr = "Salica kave";

			//
			info.eng = "";
			info.hr = "";
			setRandomText()
		}
		public function init()
		{
			this.addEventListener(MouseEvent.MOUSE_DOWN,pressMe);
			this.addEventListener(MouseEvent.MOUSE_OVER,showInfo);
			this.addEventListener(MouseEvent.MOUSE_OUT,hideInfo);

		}
		private function pressMe(e)
		{
			this["mainframe"].focusByClip(parent);
		}
		private function showInfo(e)
		{
			setRandomText()
			mainframe.showMediumInfo(this);
		}
		private function hideInfo(e)
		{
			mainframe.hideInfo();
		}
		private function setRandomText()
		{
			var r=Math.round(Math.random()*txts.length);
			info.eng=txts[r];
			info.hr=txts[r];
			trace(r);
		}
		private function setSmoke()
		{
			var def=
			{
			_img:smoke,
			_partNum:10,
			_minlifespan:700,
			_maxlifespan:2000,
			_minspeed:1,
			_maxspeed:2,
			_spread:360,
			_width:60,
			_height:60,
			_playMe:true,
			_startScale:100,
			_endScale:30,
			_wind:-.8
			
			
			};
			var pg = new ParticleGenerator(def);
			pg.x = 70;
			pg.y = 70;
			img.addChild(pg);
			pg.startGen();
		}
	}

}